package org.lex.keytool.util.process;

import java.util.concurrent.Callable;

public class ProcessWaiter implements Callable<Integer> {
	private final Process proc;

	public ProcessWaiter(Process proc) {
		this.proc = proc;
	}

	public Integer call() {
		try {
			int ret = proc.waitFor();
			System.out.println("Process=" + proc + " exitValue=" + ret);
			return ret;
		} catch (InterruptedException e) {
			System.err.println("Process=" + proc + " interrupted");
			e.printStackTrace();
			return 1;
		}
	}
}
